from collections import namedtuple

# 不能有重复值
try:
    Person = namedtuple('Person', 'name age age')
except ValueError as e:
    print(e)

# 不能与关键字一致
try:
    Person = namedtuple('Person', 'name class age')
except ValueError as e:
    print(e)
